home *** CD-ROM | disk | FTP | other *** search
-
-
-
- TTTTRRRRIIIIGGGG((((3333MMMM)))) TTTTRRRRIIIIGGGG((((3333MMMM))))
-
-
-
- NNNNAAAAMMMMEEEE
- sin, cos, tan, asin, acos, atan, atan2, fsin, sinf, fcos, cosf, ftan,
- tanf, fasin, asinf, facos, acosf, fatan, atanf, fatan2, atan2f, sinl,
- cosl, tanl, asinl, acosl, atanl, atan2l - trigonometric functions and
- their inverses
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<mmmmaaaatttthhhh....hhhh>>>>
-
- ddddoooouuuubbbblllleeee ssssiiiinnnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
- ffffllllooooaaaatttt ffffssssiiiinnnn((((ffffllllooooaaaatttt xxxx))));;;;
- ffffllllooooaaaatttt ssssiiiinnnnffff((((ffffllllooooaaaatttt xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee ssssiiiinnnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- ddddoooouuuubbbblllleeee ccccoooossss((((ddddoooouuuubbbblllleeee xxxx))));;;;
- ffffllllooooaaaatttt ffffccccoooossss((((ffffllllooooaaaatttt xxxx))));;;;
- ffffllllooooaaaatttt ccccoooossssffff((((ffffllllooooaaaatttt xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee ccccoooossssllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- ddddoooouuuubbbblllleeee ttttaaaannnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
- ffffllllooooaaaatttt ffffttttaaaannnn((((ffffllllooooaaaatttt xxxx))));;;;
- ffffllllooooaaaatttt ttttaaaannnnffff((((ffffllllooooaaaatttt xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee ttttaaaannnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- ddddoooouuuubbbblllleeee aaaassssiiiinnnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
- ffffllllooooaaaatttt ffffaaaassssiiiinnnn((((ffffllllooooaaaatttt xxxx))));;;;
- ffffllllooooaaaatttt aaaassssiiiinnnnffff((((ffffllllooooaaaatttt xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee aaaassssiiiinnnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- ddddoooouuuubbbblllleeee aaaaccccoooossss((((ddddoooouuuubbbblllleeee xxxx))));;;;
- ffffllllooooaaaatttt ffffaaaaccccoooossss((((ffffllllooooaaaatttt xxxx))));;;;
- ffffllllooooaaaatttt aaaaccccoooossssffff((((ffffllllooooaaaatttt xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee aaaaccccoooossssllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- ddddoooouuuubbbblllleeee aaaattttaaaannnn((((ddddoooouuuubbbblllleeee xxxx))));;;;
- ffffllllooooaaaatttt ffffaaaattttaaaannnn((((ffffllllooooaaaatttt xxxx))));;;;
- ffffllllooooaaaatttt aaaattttaaaannnnffff((((ffffllllooooaaaatttt xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee aaaattttaaaannnnllll((((lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- ddddoooouuuubbbblllleeee aaaattttaaaannnn2222((((ddddoooouuuubbbblllleeee yyyy,,,, ddddoooouuuubbbblllleeee xxxx))));;;;
- ffffllllooooaaaatttt ffffaaaattttaaaannnn2222((((ffffllllooooaaaatttt yyyy,,,, ffffllllooooaaaatttt xxxx))));;;;
- ffffllllooooaaaatttt aaaattttaaaannnn2222ffff((((ffffllllooooaaaatttt yyyy,,,, ffffllllooooaaaatttt xxxx))));;;;
- lllloooonnnngggg ddddoooouuuubbbblllleeee aaaattttaaaannnn2222llll((((lllloooonnnngggg ddddoooouuuubbbblllleeee yyyy,,,, \\\\
- lllloooonnnngggg ddddoooouuuubbbblllleeee xxxx))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The single-precision and long double-precision routines listed above are
- only available in the standard math library, -_l_m, and in -_l_m_x.
-
- _s_i_n, _c_o_s and _t_a_n return trigonometric functions of radian arguments x for
- double data types. _f_s_i_n, _f_c_o_s and _f_t_a_n, and their ANSI-named
- counterparts _s_i_n_f, _c_o_s_f and _t_a_n_f return trigonometric functions of radian
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- TTTTRRRRIIIIGGGG((((3333MMMM)))) TTTTRRRRIIIIGGGG((((3333MMMM))))
-
-
-
- arguments x for float data types. _s_i_n_l, _c_o_s_l and _t_a_n_l do the same for
- long double data types.
-
- The _a_s_i_n routines return the arc sine in the range -pi/2 to pi/2. The
- type of both the return value and the single argument are double for
- _a_s_i_n, float for _f_a_s_i_n and its ANSI-named counterpart _a_s_i_n_f, and long
- double for _a_s_i_n_l.
-
- The _a_c_o_s routines return the arc cosine in the range 0 to pi. The type
- of both the return value and the single argument are double for _a_c_o_s,
- float for _f_a_c_o_s and its ANSI-named counterpart _a_c_o_s_f, and long double for
- _a_c_o_s_l.
-
- The _a_t_a_n routines return the arc tangent in the range -pi/2 to pi/2. The
- type of both the return value and the single argument are double for
- _a_t_a_n, float for _f_a_t_a_n and its ANSI-named counterpart _a_t_a_n_f, and long
- double for _a_t_a_n_l.
-
- The _a_t_a_n_2 routines return the arctangent of _y/_x in the range -pi to pi
- using the signs of both arguments to determine the quadrant of the return
- value. Both the return value and the argument types are double for
- _a_t_a_n_2, float for _f_a_t_a_n_2 and its ANSI-named counterpart _a_t_a_n_2_f, and long
- double for _a_t_a_n_2_l.
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- In the diagnostics below, functions in the standard math library _l_i_b_m._a,
- are referred to as -_l_m versions, and those in the the BSD math library
- _l_i_b_m_4_3._a, are referred to as -_l_m_4_3 versions. The -_l_m versions always
- return the default Quiet NaN and set _e_r_r_n_o to EDOM when a NaN is used as
- an argument. A NaN argument usually causes the -_l_m_4_3 versions to return
- the same argument. The -_l_m_4_3 versions never set _e_r_r_n_o.
-
- If |x| > 1 the -_l_m versions of the _a_s_i_n and _a_c_o_s functions set _e_r_r_n_o to
- EDOM and return NaN. When the argument is greater than one, the return
- value of the -_l_m_4_3 versions is indeterminate.
-
- The _a_t_a_n_2 functions will return zero if both arguments are zero. The -_l_m
- versions also set _e_r_r_n_o to EDOM. (Exception: the -_l_m_4_3 versions return
- the following results:
- atan2(0.0, 0.0) = 0.0
- atan2(-0.0, 0.0) = -0.0
- atan2(0.0, -0.0) = pi
- atan2(-0.0, -0.0) = -pi )
-
- See matherr(3M) for a description of error handling for -_l_m_x functions.
-
- NNNNOOOOTTTTEEEESSSS
- Single precision routines fsin, fcos, and ftan are accurate to within 1
- ulp for arguments in the range -2**22 to 2**22. Double precision
- routines sin, cos, and tan are accurate to within 2 ulps for arguments in
- the range -2**28 to 2**28. Arguments larger than this lose precision
- rapidly, but retain more than 20 bits precision out to +/-2**50 for the
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- TTTTRRRRIIIIGGGG((((3333MMMM)))) TTTTRRRRIIIIGGGG((((3333MMMM))))
-
-
-
- double routines.
-
- Long double operations on this system are only supported in round to
- nearest rounding mode (the default). The system must be in round to
- nearest rounding mode when calling any of the long double functions, or
- incorrect answers will result.
-
- Users concerned with portability to other computer systems should note
- that the long double and float versions of these functions are optional
- according to the ANSI C Programming Language Specification ISO/IEC 9899 :
- 1990 (E).
-
- Long double functions have been renamed to be compliant with the ANSI-C
- standard, however to be backward compatible, they may still be called
- with the double precision function name prefixed with a q.
-
- The reasons for assigning a value to _a_t_a_n_2(_0,_0) are these:
-
- (1) Programs that test arguments to avoid computing _a_t_a_n_2(_0,_0) must be
- indifferent to its value. Programs that require it to be invalid are
- vulnerable to diverse reactions to that invalidity on diverse
- computer systems.
-
- (2) _a_t_a_n_2 is used mostly to convert from rectangular (x,y) to polar
- (r,theta) coordinates that must satisfy x = r*cos theta and y = r*sin
- theta. These equations are satisfied when (x=0,y=0) is mapped to
- (r=0,theta=0) In general, conversions to polar coordinates should be
- computed thus:
- r:= hypot(x,y); ... := sqrt(x*x+y*y)
- theta:= atan2(y,x).
-
- (3) The foregoing formulas need not be altered to cope in a reasonable
- way with signed zeros and infinities on machines, such as SGI 4D
- machines, that conform to IEEE 754; the versions of hypot and atan2
- provided for such a machine are designed to handle all cases. That
- is why _a_t_a_n_2(+_0,-0) = +_pi, for instance. In general the formulas
- above are equivalent to these:
- r := sqrt(x*x+y*y); if r = 0 then x := copysign(1,x);
- if x > 0 then theta := 2*atan(y/(r+x))
- else theta := 2*atan((r-x)/y);
- except if r is infinite then _a_t_a_n_2 will yield an appropriate multiple of
- pi/4 that would otherwise have to be obtained by taking limits.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- math(3M), hypot(3M), sqrt(3M), matherr(3M)
-
- AAAAUUUUTTTTHHHHOOOORRRR
- Robert P. Corbett, W. Kahan, Stuart I. McDonald, Peter Tang and, for the
- codes for IEEE 754, Dr. Kwok-Choi Ng.
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-